<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="${path}/css/editTable.css">
    <script type="text/javascript">
    	function check(){
    		var login_username = document.getElementById("login_username").value;
    		if('' == login_username){
    			alert("请输入用户名");
    			return false;
    		}
    		var login_password = document.getElementById("login_password").value;
    		if('' == login_password){
    			alert("请输入用户密码");
    			return false;
    		}
    		var mobile = document.getElementById("mobile").value;
    		if('' == mobile){
    			alert("请输入手机号码");
    			return false;
    		}
    		var email = document.getElementById("email").value;
    		if('' == email){
    			alert("请输入邮箱");
    			return false;
    		}
    		var category = document.getElementById("category").value;
    		if('' == category){
    			alert("请选择用户角色");
    			return false;
    		}
    	}
    </script>
  </head>
  
  <body>
    <div>
    	<form id="editUserInfoForm" name="editUserInfoForm" method="post" action="${path }/userInfo/updateUserInfo.action" onsubmit="return check();">
    		<p>填写用户信息</p>
    		<c:choose>
    			<c:when test="${userInfoVo.id == null }">
    				<input type="hidden" name="userInfoVo.id" value="0" />
    			</c:when>
    			<c:otherwise>
    				<input type="hidden" name="userInfoVo.id" value="${userInfoVo.id }" />
    			</c:otherwise>
    		</c:choose>
    		<table>
	    		<tr>
	    			<td>用<span style="font-family:'Times New Roman';">&nbsp;&nbsp;</span>户<span style="font-family:'Times New Roman';">&nbsp;&nbsp;</span>名</td>
	    			<td>
	    				<c:choose>
			    			<c:when test="${userInfoVo.id == null }">
			    				<input type="text" id="login_username" name="userInfoVo.login_username" value="${userInfoVo.login_username }" />
			    				<span style="color: red;size: 2px;">&nbsp;*必填项&nbsp;&nbsp;英文字母或数字组合</span>
			    			</c:when>
			    			<c:otherwise>
			    				${userInfoVo.login_username }
			    				<input type="hidden" id="login_username" name="userInfoVo.login_username" value="${userInfoVo.login_username }" />
			    			</c:otherwise>
			    		</c:choose>
	    			</td>
	    		</tr>
	    		<tr>
		    		<td>用户密码</td>
		    		<td>
		    			<input type="text" id="login_password" name="userInfoVo.login_password" value="${userInfoVo.login_password }" />
		    			<span style="color: red;size: 2px;">&nbsp;*必填项&nbsp;&nbsp;英文字母或数字组合</span>
		    		</td>
	    		</tr>
	    		<tr>
	    			<td>手机号码</td>
	    			<td><input type="text" id="mobile" name="userInfoVo.mobile" value="${userInfoVo.mobile }" size="11" maxlength="11" />
	    			<span style="color: red;size: 2px;">&nbsp;*必填项</span></td>
	    		</tr>
	    		<tr>
	    			<td>邮<span style="font-family:'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>箱</td>
	    			<td><input type="text" id="email" name="userInfoVo.email" value="${userInfoVo.email }" />
	    			<span style="color: red;size: 2px;">&nbsp;*必填项</span></td>
	    		</tr>
	    		<tr>
	    			<td>角<span style="font-family:'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>色</td>
	    			<td>
	    				<select id="category" name="userInfoVo.category">
	    					<option value="">---请选择---</option>
	    					<option value="0" <c:if test="${userInfoVo.category eq 0 }">selected="selected"</c:if>>超级管理员</option>
	    					<option value="1" <c:if test="${userInfoVo.category eq 1 }">selected="selected"</c:if>>渠道管理员</option>
	    					<option value="5" <c:if test="${userInfoVo.category eq 5 }">selected="selected"</c:if>>普通用户</option>
	    				</select>
	    			</td>
	    		</tr>
	    		<tr>
	    			<td colspan="2"><input type="submit" name="submit" value="确认" /></td>
	    		</tr>
	    	</table>
		</form>
    </div>
  </body>
</html>
